home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 003 / tpbsave.arc / BLOAD.INC < prev    next >
Encoding:
Text File  |  1988-08-11  |  1.1 KB  |  57 lines

  1. procedure bload(filename:string);
  2.  
  3. {$m 40000,0,655360}
  4. {You might need to change the heapmax for your system}
  5.  
  6. {BEAHM 8/11/88}
  7.  
  8. {THIS PROCEDURE WILL LET YOU BLOAD A BASIC CGA GRAPHIC WITH YOUR TURBO
  9.  PASCAL 4.0.  YOU WILL HAVE TO INITIALIZE THE GRAPHICS AND SET THE GRAPH
  10.  MODE IN YOUR MAIN PROGRAM BEFORE YOU CALL BLOAD}
  11.  
  12. type
  13.     bspic=array[0..16200] of byte;
  14.  
  15. var
  16.    ifyle:file of bspic;
  17.    a,
  18.    b:bspic;
  19.    x,
  20.    y,
  21.    z:integer;
  22.  
  23.  
  24. begin
  25.      assign(ifyle,filename);
  26.      reset(ifyle);
  27.      read(ifyle,a);
  28.      close(ifyle);
  29.  
  30.      {you need to have initialized the graphics in the main program
  31.       before you call BLOAD}
  32.  
  33.      getimage(0,0,getmaxx,getmaxy,b);
  34.  
  35.      z:=6;
  36.  
  37.     for x:=0 to 99 do
  38.          for y:=0 to 79 do
  39.              begin
  40.                   z:=z+1;
  41.                   b[x*160+y+4]:=a[z];
  42.              end;
  43.  
  44.      z:=z+192; {NECESSARY TO SKIP TO SECOND HALF OF BSAVED GRAPHIC}
  45.  
  46.      for x:=0 to 99 do
  47.          for y:=0 to 79 do
  48.              begin
  49.                   z:=z+1;
  50.                   b[x*160+y+84]:=a[z];
  51.              end;
  52.  
  53.      putimage(0,0,b,normalput);
  54.  
  55. end;
  56.  
  57.